package org.demo.patten.template_method;

import java.util.List;

/**
 * @author zhuj
 * @date 2025/3/29
 * @apiNote
 */
public abstract class ReportExporter {
    // 模板方法：不可重写
    public final String export() {
        List<String> data = queryData();
        String formatted = format(data);
        String filePath = writeToFile(formatted);
        return filePath;
    }
    // 步骤抽象
    protected abstract List<String> queryData();
    protected abstract String format(List<String> data);
    protected abstract String writeToFile(String content);
}
